package com.youhp.spire.xls.demo.Workbook;

import com.spire.xls.*;
import java.io.*;

public class SaveStream {
    public static void main(String[] args) throws IOException {
        String inputFile = "data/ExcelSampleN.xlsx";
        String outputFile = "output/SaveStream_out.xlsx";

        //Create a workbook and load a file
        Workbook workbook = new Workbook();
        workbook.loadFromFile(inputFile);

        //Save the excel workbook to stream
        FileOutputStream outputStream = new FileOutputStream(outputFile);
        workbook.saveToStream(outputStream, FileFormat.Version2010);

        //Close the stream
        outputStream.close();
    }
}
